package com.hdaccp.xingmu.controller;

import com.hdaccp.xingmu.dao.PartoltypeDao;
import com.hdaccp.xingmu.entity.Partoltype;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.util.List;

@Controller
@RequestMapping("/partoltype")
public class PartoltypeCon {


    @Autowired
    private PartoltypeDao partoltypeDao;


    @PersistenceContext
    private EntityManager entityManager ;

    @RequestMapping("/quanbu")
    @ResponseBody
    public List<Partoltype> query(){
        return partoltypeDao.findAll() ;
    }


}
